package vip.xiaonuo.modular.business.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.business.param.BiUserStore.QueryParam;
import vip.xiaonuo.modular.business.service.UserStoreService;
import vip.xiaonuo.modular.manage.bicouponwrite.param.BiCouponWriteParam;

import javax.annotation.Resource;

/**
 * @Description 门店信息
 * @Author cy
 * @Date 2022/8/4 14:41
 * @Version 1.0
 */
@Api(tags = "门店信息")
@RestController
public class UserStoreController {

    @Resource
    private UserStoreService userStoreService;

    @ApiOperation("用户经营网点查询")
    @PostMapping("/business/userStore/list")
    @BusinessLog(title = "用户经营网点查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.list(queryParam));
    }

    @ApiOperation("指定网点经营数据")
    @PostMapping("/business/userStore/storeBusiList")
    @BusinessLog(title = "指定网点经营数据", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData storeBusiList(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.storeBusiList(queryParam));
    }

    /**
     * 门店订单信息页面汇总
     * @param queryParam
     * @return
     */
    @PostMapping("/business/userStore/storeOrderInfo")
    public ResponseData storeOrderInfo(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.storeOrderInfo(queryParam));
    }

    /**
     * 门店订单信息页面列表查询
     * @param queryParam
     * @return
     */
    @PostMapping("/business/userStore/storeOrderList")
    public ResponseData storeOrderList(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.storeOrderList(queryParam));
    }

    /**
     * 商铺销量排行
     * @param queryParam
     * @return
     */
    @PostMapping("/business/userStore/storeSalesRank")
    public ResponseData storeSalesRank(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.storeSalesRank(queryParam));
    }

    @PostMapping("/business/userStore/storeInformation")
    public ResponseData storeInformation(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.storeInformation(queryParam));
    }

    @PostMapping("/business/userStore/storeCompare")
    public ResponseData storeCompare(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.storeCompare(queryParam));
    }

    @PostMapping("/business/userStore/storeCouponInfo")
    public ResponseData storeCouponInfo(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.storeCouponInfo(queryParam));
    }
    @PostMapping("/business/userStore/storeCouponList")
    public ResponseData storeCouponList(@RequestBody BiCouponWriteParam queryParam){
        return new SuccessResponseData(userStoreService.storeCouponList(queryParam));
    }

    @PostMapping("/business/userStore/storeSearch")
    public ResponseData storeSearch(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.storeSearch(queryParam));
    }

    @PostMapping("/business/userStore/showStoreGrid")
    public ResponseData showStoreGrid(@RequestBody QueryParam queryParam){
        return new SuccessResponseData(userStoreService.showStoreGrid(queryParam));
    }

}
